// ProblemTest.java
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;

public class ProblemTest {
    private ProblemSet problemSet;

    @Before
    public void setUp() {
        problemSet = new ProblemSet();
        for (int i = 0; i < 50; i++) {
            problemSet.addProblem(ProblemFactory.createAdditionProblem());
            problemSet.addProblem(ProblemFactory.createSubtractionProblem());
        }
    }

    @Test
    public void testAdditionProblem() {
        Problem problem = ProblemFactory.createAdditionProblem();
        assertTrue(problem.getQuestion().matches("\\d+ \\+ \\d+ \\s= \\?"));
    }

    @Test
    public void testSubtractionProblem() {
        Problem problem = ProblemFactory.createSubtractionProblem();
        assertTrue(problem.getQuestion().matches("\\d+ \\- \\d+ \\s= \\?"));
    }

    @Test
    public void testProblemSetSize() {
        assertEquals(100, problemSet.size());
    }
}